package alg20250209;

public class Text {
    public int[] twoSum(int[] price, int target) {
        int n = price.length;
        int left = 0, right = n - 1;
        while(left < right){
            if(price[left] + price[right] > target) right--;
            else if(price[left] + price[right] == target) break;
            else left++;
        }
        int[] ret = {price[left], price[right]};
        return ret;
    }
}
